<?php
namespace Admin\Controller;
use Think\Controller;
class SystemController extends CommonController {
	public function info(){  //网站设置
		//网站基本信息
		$systemM = M('config');
		$data = $systemM->select();
		foreach ($data as $rs){
			$info[$rs['name']] = $rs['value'];
		}
		   // dump($info);exit;
		 $this->assign('info',$info);
		$this->display();
	}
	//处理数据
	public function edit(){
		foreach($_POST as $k=>$v){
		// $sql = "UPDATE ".$ecs->table('config')." SET "."value = '$v' "." WHERE name = '$k'";  
	 	M('config')->where("name='".$k."'")->save(array('value'=>$v));
	    // $db->query($sql);
		}
		$this->success('修改成功');
	}
	 
}